• File: proxy-cg9959.php
  • Full Path: C:/htdocs/reeft_gps_test/REEFTintegrationLog/saved/proxy-cg9959.php
  • Date Modified: 04/30/2025 7:56 AM
  • File size: 2.82 KB
  • MIME-type: text/x-php
  • Charset: utf-8
<?php
//======================================================================================
//
// Function: Get data from PRMS - CG8150	
// 
// Programmer: DKXJJ
// Date      : 2018-09-16	
//
//
// Copyright Reeft A/S (c) - 2018
//=====================================================================================

	if (isset($_REQUEST["reference"]))	$reference	= $_REQUEST["reference"]; 	
	else $reference = '';	

	if (isset($_REQUEST["prodid"]))	$prodid	= $_REQUEST["prodid"]; 	
	else $prodid = '';	


//======================================================================================	
// Set line
//======================================================================================	

	if ( $reference == 'Line1') $line = 'LA';
	if ( $reference == 'Line2') $line = 'LB';
	if ( $reference == 'Line3') $line = 'LC';
	if ( $reference == 'Line4') $line = 'LD';
	if ( $reference == 'Line5') $line = 'LE';
	if ( $reference == 'Line11') $line = 'LA';
	if ( $reference == 'Testline') $line = 'LK';


//======================================================================================	
// Split prodid
//======================================================================================	

	$wrkAry = explode('-',$prodid);
	
	$wxmod = $wrkAry[0];
	$wxmnr = $wrkAry[1];
	$wxpnc = $wrkAry[2];
	
//======================================================================================	
// Set your return content type
//======================================================================================
	header('Content-Type: text/xml; charset=utf-8');

//======================================================================================	
// Create webservice URL
//======================================================================================
	
	$P01 = 'ly9asp01.epr.electroluxprofessional.com';
	$PORT = 80;
	
	$P01 = 'ly9asd01.epr.electroluxprofessional.com';
	$PORT = 81;
	
	$IP = $P01;

	$daurl 	= 'http://' . $IP . ':' . $PORT . '/cgi-bin/CG9959'
			. '?line=' 		. trim($line)
			. '&reference=' . trim($reference)
			. '&wxmod=' 	. trim($wxmod)
			. '&wxmnr=' 	. trim($wxmnr)
			. '&wxpnc=' 	. trim($wxpnc)
			;

	// echo $daurl;
	// exit;
		
//======================================================================================
// Get that website's content
//======================================================================================
	$handle = fopen($daurl, "r");

//======================================================================================	
// If there is something, read and return
//======================================================================================
	if ($handle) {
		while (!feof($handle)) {
			$buffer = fgets($handle, 5000);
			echo htmlspecialchars_decode($buffer);
		}
		fclose($handle);
	}
	

?>